# import os
#
# from dotenv import load_dotenv
# from langchain.agents import create_tool_calling_agent, AgentExecutor
# from langchain_community.agent_toolkits.load_tools import load_tools
# from langchain_community.callbacks import get_openai_callback
# from langchain_core.prompts import ChatPromptTemplate
# from langchain_ollama import OllamaLLM
# from langchain_openai import AzureChatOpenAI
#
# prompt = ChatPromptTemplate.from_messages(
#     [
#         ("system", "您是一个乐于助人的助手"),
#         ("human", "{input}"),
#         ("placeholder", "{agent_scratchpad}")
#
#     ]
# )
#
#
# load_dotenv()
#
# llm = AzureChatOpenAI(
#     # openai_api_key=
#     # openai_api_base=os.getenv("AZURE_OPENAI_ENDPOINT"),
#     api_key=os.getenv("AZURE_OPENAI_API_KEY"),
#     azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT"),
#     azure_deployment=os.getenv("AZURE_OPENAI_DEPLOYMENT_NAME"),
#     api_version=os.getenv("AZURE_OPENAI_API_VERSION"),
#     temperature=0.7
# )
#
# ## openai
# # llm = OllamaLLM(model="llama3.2:3b")
#
# tools = load_tools(["wikipedia"])
# agent = create_tool_calling_agent(llm, tools, prompt)
# agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
#
#
# with get_openai_callback() as cb:
#     response = agent_executor.invoke(
#         {
#             "input":"蜂鸟的学名是什么，哪种鸟是最快的"
#         }
#     )
#     print(f"总令牌数：{cb.total_tokens}")
#     print(f"提示令牌：{cb.prompt_tokens}")
#     print(f"完成令牌：{cb.completion_tokens}")
#     print(f"总成本（美元）：{cb.total_cost}")
#
